﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DevComponents.DotNetBar;
using System.IO;

namespace HYWJ.jxgl
{
    public partial class ZLGLForm : Office2007Form
    {
        public ZLGLForm()
        {
            InitializeComponent();
        }

        private void ZLGLForm_Load(object sender, EventArgs e)
        {
            path(Application.StartupPath+@"\media");
        }
        
        void path(string filepath)
        {
            listView1.View = View.Details;
            listView1.Columns.Clear();
            listView1.Items.Clear();
            listView1.Columns.Add("目录名称 ", 100, HorizontalAlignment.Left);
            listView1.Columns.Add("创建时间 ", 200, HorizontalAlignment.Left);
            listView1.Columns.Add("上次访问时间 ", 200, HorizontalAlignment.Left);



            DirectoryInfo m_DictyInfo = new DirectoryInfo(filepath);
            DirectoryInfo[] diArr = m_DictyInfo.GetDirectories();
            foreach (DirectoryInfo m_Directory in diArr)
            {
                ListViewItem m_Item = this.listView1.Items.Add(m_Directory.Name);
                m_Item.SubItems.Add(m_Directory.CreationTime.ToString());
                m_Item.SubItems.Add(m_Directory.LastAccessTime.ToString());

            }
            FileInfo[] m_FilesInfo = m_DictyInfo.GetFiles();
            foreach (FileInfo m_File in m_FilesInfo)
            {
                ListViewItem m_Item = this.listView1.Items.Add(m_File.Name);
                m_Item.SubItems.Add(m_File.CreationTime.ToString());
                m_Item.SubItems.Add(m_File.LastAccessTime.ToString());

            }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            path(Application.StartupPath + @"\media\yuyin");
        }

        private void button2_Click(object sender, EventArgs e)
        {
            path(Application.StartupPath + @"\media\pic");
        }

        private void button3_Click(object sender, EventArgs e)
        {
            path(Application.StartupPath + @"\media\sound");
        }

        private void button4_Click(object sender, EventArgs e)
        {
            path(Application.StartupPath + @"\media\video");
        }

    }
}
